package conexao;

import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;

public class Conexao {

	private Connection conexao = null;
	private Statement st;
	private PreparedStatement ps;

	
	public Connection getConexao() throws Exception{
		
	 try{
		
		DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
		conexao = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","sa");
        st = conexao.createStatement();
        
        return conexao;
        
	  }catch (Exception e){
			
		 throw new Exception("Ocorreu um erro na conexao do drive do servidor de banco de dados.");

		}
	}
		
	
	public Statement getStatement(){

	    return st;

	}

	public PreparedStatement getPreparedStatement(){

	    return ps;

	}
	
}
